window.onload = function() {
  const allPageName = [
    htmlPage,
    cssPage,
    jsPage,
    ajaxPage,
    axiosPage,
    nodePage,
    vuePage,
    reactPage,
    liveactionPage,
    httpPage,
    webpackPage,
  ];

  // 解析location.search
  let cli = parseInt(location.search.slice(location.search.indexOf('=') + 1));
  pageCopyControFn(allPageName[cli], cli);

  // 按钮控制内容展示/隐藏
  for(let i = 0; i < QQ('.fw_btn').length; i++) {
    QQ('.fw_btn')[i].onclick = function() {
      this.innerHTML === 'Show Ans.' ? this.innerHTML = 'Hide Ans.' : this.innerHTML = 'Show Ans.';
      this.parentNode.querySelector('.fw_content').classList.toggle('hide');
    }
  }
}
